{fx_template 'common/header-base'}
{if !MERCHANTID}
{php $frames = buildframes(FRAME);_calc_current_frames($frames);}
{/if}
<div data-skin="default" class="skin-default {if $_GPC['main-lg']} main-lg-body {/if}">
{if !$_W['merch_error']}
<div class="head">
	<nav class="navbar navbar-default" role="navigation">
		<div class="container {if !empty($frames['section']['platform_module_menu']['plugin_menu'])}plugin-head{/if}">
			<div class="navbar-header">
				<a class="navbar-brand" href="{if !MERCHANTID}{$_W['siteroot']}{else}{php echo FX_URL . 'web/merch.php';}{/if}">
					<img src="{if !empty($_W['setting']['copyright']['blogo'])}{php echo tomedia($_W['setting']['copyright']['blogo'])}{else}{$_W['siteroot']}web/resource/images/logo/logo.png{/if}" class="pull-left" width="110px" height="35px">
					<span class="version hidden">{IMS_VERSION}</span>
				</a>
			</div>
            <style>.head .navbar-right, .head .navbar-left,.navbar-nav > li > a{ font-size:inherit; line-height:25px;}</style>
			{if !empty($_W['uid']) || $_SESSION['role']=='merchant'}
			<div class="collapse navbar-collapse">
                {if $_SESSION['role']=='merchant'}
                <ul class="nav navbar-nav navbar-left">
                    <li{if $_GPC['ac']=='merchant'} class="active"{/if}><a href="{php echo web_url('application/merchant/setting')}"><i class="fa fa-desktop"></i>&nbsp;&nbsp; 管理中心</a></li>
                    <li{if $_GPC['ac']=='activity'} class="active"{/if}><a href="{php echo web_url('activity/activity/display')}"><i class="fa fa-gift"></i>&nbsp;&nbsp; 活动管理</a></li>
                    <li{if $_GPC['ac']=='records'} class="active"{/if}><a href="{php echo web_url('records/records/display')}"><i class="fa fa-list"></i>&nbsp;&nbsp; 报名管理</a></li>
                    <li{if $_GPC['do']=='application' && $_GPC['ac']!='merchant'} class="active"{/if}><a href="{php echo web_url('application/plugins/display')}"><i class="fa fa-cubes"></i>&nbsp;&nbsp; 应用扩展</a></li>
				</ul>
			    <ul class="nav navbar-nav navbar-right">
					<li>
						<a href="javascript:;"  data-toggle="dropdown" style="display:block; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><img src="{php echo tomedia($_SESSION['role_logo'])}?time={php echo time()}" class="img-responsive img-thumbnail" width="30"/> {$_SESSION['role_name']} </a>
					</li>
					<li>
						<a href="{php echo web_url('user/logout');}" style="display:block; max-width:185px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-sign-out"></i>退出系统 </a>
					</li>
				</ul>
			    {else}
                <ul class="nav navbar-nav navbar-left">
					<li{if $_GPC['ac']=='welcome'} class="active"{/if}><a href="{php echo url('platform/cover', array('eid' => $entries['cover'][0]['eid'], 'version_id' => 0))}"><i class="fa fa-home"></i>&nbsp;&nbsp; 首页</a></li>
                    <li{if $_GPC['ac']=='activity'} class="active"{/if}><a href="{php echo web_url('activity/activity/display')}"><i class="fa fa-gift"></i>&nbsp;&nbsp; 活动管理</a></li>
                    <li{if $_GPC['ac']=='records'} class="active"{/if}><a href="{php echo web_url('records/records/display')}"><i class="fa fa-list"></i>&nbsp;&nbsp; 报名管理</a></li>
                    <li{if $_GPC['ac']=='member'} class="active"{/if}><a href="{php echo web_url('member/member/display')}"><i class="fa fa-user"></i>&nbsp;&nbsp; 会员管理</a></li>
                    <li{if $_GPC['do']=='application'} class="active"{/if}><a href="{php echo web_url('application/plugins/display')}"><i class="fa fa-cubes"></i>&nbsp;&nbsp; 应用扩展</a></li>
				</ul>
				<ul class="nav navbar-nav navbar-right">
					<li class="dropdown">
						<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"><i class="wi wi-user color-gray"></i>{$_W['user']['username']} <span class="caret"></span></a>
						<ul class="dropdown-menu color-gray" role="menu">
							<li>
								<a href="{url 'user/profile'}" target="_blank"><i class="wi wi-account color-gray"></i> 我的账号</a>
							</li>
							{if $_W['isfounder']}
							<li class="divider"></li>
							{if uni_user_see_more_info(ACCOUNT_MANAGE_NAME_VICE_FOUNDER, false)}
							<li><a href="{url 'cloud/upgrade'}" target="_blank"><i class="wi wi-update color-gray"></i> 自动更新</a></li>
							{/if}
							<li><a href="{url 'system/updatecache'}" target="_blank"><i class="wi wi-cache color-gray"></i> 更新缓存</a></li>
							<li class="divider"></li>
							{/if}
							<li>
								<a href="{url 'user/logout'}"><i class="fa fa-sign-out color-gray"></i> 退出系统</a>
							</li>
						</ul>
					</li>
				</ul>
                {/if}
			</div>
			{else}
			<div class="collapse navbar-collapse">
				<ul class="nav navbar-nav navbar-right">
					<li class="dropdown"><a href="{php echo url('user/register');}">注册</a></li>
					<li class="dropdown"><a href="{php echo url('user/login');}">登录</a></li>
				</ul>
			</div>
			{/if}
		</div>
	</nav>
</div>
{/if}
{if empty($_COOKIE['check_setmeal']) && !empty($_W['account']['endtime']) && ($_W['account']['endtime'] - TIMESTAMP < (6*86400))}
<div class="system-tips we7-body-alert" id="setmeal-tips">
	<div class="container text-right">
		<div class="alert-info">
			<a href="{if $_W['isfounder']}{php echo url('user/edit', array('uid' => $_W['account']['uid']));}{else}javascript:void(0);{/if}">
				该公众号管理员服务有效期：{php echo date('Y-m-d', $_W['account']['starttime']);} ~ {php echo date('Y-m-d', $_W['account']['endtime']);}.
				{if $_W['account']['endtime'] < TIMESTAMP}
				目前已到期，请联系管理员续费
				{else}
				将在{php echo floor(($_W['account']['endtime'] - strtotime(date('Y-m-d')))/86400);}天后到期，请及时付费
				{/if}
			</a>
			<span class="tips-close" onclick="check_setmeal_hide();"><i class="wi wi-error-sign"></i></span>
		</div>
	</div>
</div>
<script>
	function check_setmeal_hide() {
		util.cookie.set('check_setmeal', 1, 1800);
		$('#setmeal-tips').hide();
		return false;
	}
</script>
{/if} 
<div class="main">
{if !defined('IN_MESSAGE')}
<div class="container">
	<a href="javascript:;" class="js-big-main button-to-big color-gray" title="加宽">{if $_GPC['main-lg']}正常{else}宽屏{/if}</a>
	<div class="panel panel-content main-panel-content {if !empty($frames['section']['platform_module_menu']['plugin_menu'])}panel-content-plugin{/if}">
		<div class="content-head panel-heading main-panel-heading">
        {if !MERCHANTID}
			{if ($_GPC['c'] != 'cloud' && !empty($_GPC['m']) && !in_array($_GPC['m'], array('keyword', 'special', 'welcome', 'default', 'userapi', 'service'))) || defined('IN_MODULE')}
				{fx_template 'common/header-module'}
			{else}
				{fx_template 'common/header-' . FRAME}
			{/if}
        {else}
        	{fx_template 'common/header-module'}
        {/if}
		</div>
	<div class="panel-body clearfix main-panel-body {if !empty($_W['setting']['copyright']['leftmenufixed'])}menu-fixed{/if}">
    	<style>.panel-content-plugin .panel-menu .list-group-item:not(.list-group-more){padding-left:30px;}</style>
		<div class="left-menu">
        {php fx_load()->func('tpl');}
        {php $getlistFrames = 'get'.$controller.'Frames';}
        {php $_frames = $getlistFrames();}
        {php $_frames = empty($_frames) ? $GLOBALS['frames'] : $_frames; _calc_current_frames2($_frames);}
        {if MERCHANTID}
            <style>.left-menu .fa{width:14px;}</style>
			<div class="left-menu-content">
            	{loop $_frames $k $frame}
                <div class="panel panel-menu">
                    <div class="panel-heading">
                        <span class="no-collapse">{$frame['title']}</span>
                    </div>
                    <ul class="list-group">
                        {loop $frame['items'] $link}
                        <li class="list-group-item {$link['active']}">
                            <a href="{$link['url']}" class="text-over">{$link['title']}</a>
                        </li>
                        {/loop}
                    </ul>
                </div>
                {/loop}
			</div>
        {else}
        	<style>.left-menu .no-fa .fa{display:none}</style>
        	{if empty($frames['section']['platform_module_menu']['plugin_menu'])}
            <div class="left-menu-content">
                {loop $_frames $k $frame}                               
                <div class="panel panel-menu">
                    <div class="panel-heading" style="padding-left:0;">
                        <span class="no-collapse no-fa">{php echo str_replace('&nbsp;','',$frame['title'])}<i class="wi wi-appsetting pull-right setting"></i></span>
                    </div>
                    <ul class="list-group panel-collapse">
                        {loop $frame['items'] $link}
                        <li class="list-group-item {$link['active']}">
                            <a href="{$link['url']}" class="text-over">{php echo str_replace('&nbsp;','',$link['title'])}</a>
                        </li>
                        {/loop}                            
                    </ul>
                </div>
                {/loop}
            </div>
        	{else}
            <div class="plugin-menu clearfix">
                <div class="plugin-menu-main pull-left">
                    <ul class="list-group">
                        <li class="list-group-item{if $_W['current_module']['name'] == $frames['section']['platform_module_menu']['plugin_menu']['main_module']} active{/if}">
                            <a href="{php echo url('home/welcome/ext', array('m' => $frames['section']['platform_module_menu']['plugin_menu']['main_module']))}">
                                <i class="wi wi-main-apply"></i>
                                <div>主应用</div>
                            </a>
                        </li>
                        <li class="list-group-item">
                            <div>插件</div>
                        </li>
                        {loop $frames['section']['platform_module_menu']['plugin_menu']['menu'] $plugin_name $plugin}
                        <li class="list-group-item{if $_W['current_module']['name'] == $plugin_name} active{/if}">
                            <a href="{php echo url('home/welcome/ext', array('m' => $plugin_name))}">
                                <img src="{$plugin['icon']}" alt="" class="img-icon" />
                                <div>{$plugin['title']}</div>
                            </a>
                        </li>
                        {/loop}
                    </ul>
                    {php unset($plugin_name);}
                    {php unset($plugin);}
                </div>
                <div class="plugin-menu-sub pull-left"> 
                	{loop $_frames $k $frame}                               
                    <div class="panel panel-menu">
                        <div class="panel-heading" style="padding-left:0;">
                        	<span class="no-collapse no-fa">{php echo str_replace('&nbsp;','',$frame['title'])}<i class="wi wi-appsetting pull-right setting"></i></span>
                        </div>
                        <ul class="list-group panel-collapse">
                        	{loop $frame['items'] $link}
                            <li class="list-group-item {$link['active']}">
                                <a href="{$link['url']}" class="text-over"><i class="fa fa-cog"></i>{php echo str_replace('&nbsp;','',$link['title'])}</a>
                            </li>
                            {/loop}                            
                        </ul>
                    </div>
                    {/loop}
            	</div>
            </div>
            {/if}
        {/if}
		</div>
		<div class="right-content">
{/if}
